package gold.digger;

import gold.utils.InputUtil;

/**
 * Created by fanzhenyu02 on 2021/12/10.
 * common problem solver template.
 */
public class LC1725 {
    public long startExecuteTime = System.currentTimeMillis();


    class Solution {
        public int countGoodRectangles(int[][] rectangles) {
            int res = 0, maxLen = 0;
            for (int[] rectangle : rectangles) {
                int l = rectangle[0], w = rectangle[1];
                int k = Math.min(l, w);
                if (k == maxLen) {
                    ++res;
                } else if (k > maxLen) {
                    res = 1;
                    maxLen = k;
                }
            }
            return res;
        }
    }


    public void run() {
        Solution solution = new Solution();
        int[] arr = InputUtil.toIntegerArray("[1,2,3]");
        System.out.println(solution.toString());
    }

    public static void main(String[] args) throws Exception {
        LC1725 an = new LC1725();
        an.run();

        System.out.println("\ncurrent solution total execute time: " + (System.currentTimeMillis() - an.startExecuteTime) + " ms.");
    }
}
